#include "GameFrame.h"
#include <NiMain.h>
#include <NiAnimation.h>
#include <NiParticle.h>
#include <NiLicense.h>

NiEmbedGamebryoLicenseCode;

CGameFrame::CGameFrame()
:NiApplication("Korman Game",DEFAULT_WIDTH, DEFAULT_HEIGHT, true)
{
	SetMediaPath("../../Data/");
}

CGameFrame::~CGameFrame(){}

bool CGameFrame::CreateScene()
{
	NiAlphaAccumulator* pkAccum = NiNew NiAlphaAccumulator;
	m_spRenderer->SetSorter(pkAccum);

	NiStream kStream;

	bool bSuccess = kStream.Load(NiApplication::ConvertMediaFilename("WORLD.NIF"));

	if (!bSuccess)
	{
		NiMessageBox("WORLD.NIF file could not be loaded!", "NIF Error");
		return false;
	}

	m_spScene = (NiNode*) kStream.GetObjectAt(0);
	NIASSERT(NiIsKindOf(NiNode, m_spScene));

	return true;
}

NiApplication* NiApplication::Create()
{
	return NiNew CGameFrame;
}